home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_01_bab_cinematic_4.cog < prev    next >
Text File  |  1999-11-15  |  28KB  |  872 lines

  1. # Jones 3D Cog Script
  2. #
  3. # 01_BAB_Cinematic_4.cog
  4. #
  5. # Kazakstan Exposition with Indy & Turner ends Babylon Chapter
  6. #
  7. # [HB]
  8. #
  9. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ===================================================================
  12.  
  13. symbols
  14.  
  15.     # ************************ MESSAGES ************************
  16.  
  17.     message        startup
  18.     message     crossed
  19.     message        entered
  20.     message        activated
  21.     
  22.     # ************************ KEYFRAMES ***********************
  23.     
  24.     keyframe    in_PushHat=0in_figithat_4_4.key            local
  25.     keyframe    in_ArmsOut=0in_armsout_1_1.key            local
  26.     keyframe    in_Gesture=0in_armsup_1_1.key            local
  27.     keyframe    in_Think=0in_thinking_4_4.key            local
  28.     keyframe    in_leftarm=0in_leftarm_1_1.key            local
  29.     
  30.     keyframe    in_handsSide=0in_stand1.key                local
  31.     keyframe    in_armsCrossed=0in_stand2.key            local
  32.     keyframe    in_handsOnHips=0in_stand4.key            local
  33.     keyframe    in_crossArms=0in_stand1_bd_2.key           local
  34.     keyframe    in_handsToHips=0in_stand1_bd_4.key           local
  35.     keyframe    in_handsToSide=0in_stand4_bd_1.key           local
  36.     keyframe    in_showMarduk=0in_holdstatue_1_hold.key    local
  37.     keyframe    in_giveMarduk=0in_givestatue_hold_1.key    local
  38.     keyframe    in_inscription=0in_inscription_1_1.key    local
  39.     keyframe    in_urgon=0in_urgon_1_1.key                local
  40.     keyframe    in_heavenly=0in_tianshan_1_1.key        local
  41.     keyframe    in_Smash=0in_smash_1_4.key                local
  42.     
  43.     keyframe    jpa_mountJeep=ij_sitdown.key            local
  44.     keyframe    jpa_steerL=ij_turnL.key                    local
  45.     keyframe    jpa_steerR=ij_turnR.key                    local
  46.     keyframe    jpa_wheelsFwd=ij_wheelturn.key            local
  47.     
  48.     keyframe    trn_handships=0tu_stand1.key            local
  49.     keyframe    trn_armsFold=0tu_stand2.key                local
  50.     keyframe    trn_handsSide=0tu_stand3.key            local
  51.     keyframe    trn_handstohips=0tu_stand3_bd_1.key        local
  52.     keyframe    trn_lounge=0tu_stand6.key                local
  53.     keyframe    trn_tenhut=0tu_stand6_bd_1.key            local
  54.     keyframe    trn_fistshake=0tu_pointout_1_1.key        local
  55.     keyframe    trn_givekey=0tu_hndkey_1_1.key            local
  56.     keyframe    trn_beMyGuest=0tu_funeral_3_2.key        local
  57.     keyframe    trn_foldArms=0tu_stand1_bd_2.key        local
  58.     keyframe    trn_leftUp=0tu_leftarm_1_1.key            local
  59.     keyframe    trn_nothelp=0tu_nothelp_1_1.key            local
  60.     keyframe    trn_reach=0tu_reach_1_1.key                local
  61.     keyframe    trn_getMarduk=0tu_takestatue_1_hold.key    local
  62.     keyframe    trn_stowMarduk=0tu_putawaystatue_hold_1.key        local
  63.     keyframe    trn_sovietland=0tu_lasttime_1_1.key        local
  64.     
  65.     keyframe    jeep_idle=ij_idle.key                   local
  66.     keyframe    jeep_fwd_rev=ij_fwd_bd_rev.key          local
  67.     keyframe    jeep_rev_fwd=ij_rev_bd_fwd.key          local
  68.     keyframe    jeep_turnleft=ij_turnL.key              local
  69.     keyframe    jeep_turnright=ij_turnR.key             local
  70.     keyframe    jeep_rturnleft=ij_rev_turnL.key         local
  71.     keyframe    jeep_rturnright=ij_rev_turnR.key        local
  72.     keyframe    jeep_runforward=ij_fwd.key              local
  73.     keyframe    jeep_runbackward=ij_rev.key             local
  74.        
  75.     # ************************* MODELS *************************
  76.         
  77.     model          mod_in=gen_in_shirt.3do                    local
  78.     model        mod_trn=gen_tu.3do                        local
  79.     model       inhand_mdkstat=hand_in_mrdkstat.3do     local
  80.     model       tuhand_mdkstat=hand_tu_mrdkstat.3do     local
  81.     model       tu_hand=hand_in.3do                     local
  82.  
  83.     # ************************* SOUNDS *************************
  84.     
  85.     sound        trn_GotStatue=Bb11t01.wav                local
  86.     sound        in_NotYet=Bb11j02.wav                    local
  87.     sound        trn_HelpEachOther=Bb11t03.wav            local
  88.     sound        trn_WhereStatue=Bb11t04.wav                local
  89.     sound        in_WorkOnIt=bb11j05.wav                    local
  90.     sound        trn_BeWaiting=Bb11t06.wav                local
  91.     sound        trn_StatueJones=Bb11t12.wav                local
  92.     sound        in_YeahIKnow=Bb11j08.wav                local
  93.     sound        trn_StillWaiting=Bb11t09.wav            local
  94.     sound        in_ThisDo=Bb11j13.wav                    local
  95.     sound        trn_JustMight=Bb11t14.wav                local
  96.     sound        in_TowerExpo=Bb11j15.wav                local
  97.     sound        trn_DisciplesWhere=Bb11t16.wav            local
  98.     sound        in_NotSure=Bb11j17.wav                    local
  99.     sound        trn_NotMuch=Bb11t18.wav                    local
  100.     sound        in_Enough=Bb11j19.wav                    local
  101.     sound        trn_KazakSoviet=Bb11t20.wav                local
  102.     sound        in_NoPassport=Bb11j21.wav                local
  103.     sound        trn_YourFuneral=Bb11t22.wav                local
  104.  
  105.     sound       itsawrap=mus_gen_indy_a_theme1.wav      local
  106.     
  107.     sound       jeep_start_wav=jep_engine_start.WAV     local
  108.     sound       jeep_rev_wav=jep_reverse_loop.WAV       local
  109.     sound       jeep_shift_wav=jep_sus_crk_4.WAV        local
  110.     sound       jeep_fwd_wav=jep_engine_loop.WAV        local
  111.     
  112. # ************************* THINGS *************************
  113.  
  114.     thing        player                                    local
  115.                             
  116.     thing        indy                                    linkid=0
  117.     thing        turner                                    linkid=1
  118.     thing        indyAlt                                    linkid=2
  119.     thing        indyghost                                local
  120.                                                 
  121.     thing        in_mark_2                                  nolink
  122.     thing        in_mark_3                                nolink
  123.  
  124.     thing        trn_mark_2                                nolink
  125.     thing        trn_mark_3                                nolink
  126.     
  127.     thing        cam_1                                    nolink
  128.     thing        cam_2                                    nolink
  129.     thing        cam_3                                    nolink
  130.     thing        cam_4                                    nolink
  131.     thing        cam_5                                    nolink
  132.     thing        cam_6                                    nolink
  133.     thing        cam_7                                    nolink
  134.     thing        cam_8                                    nolink
  135.     thing        cam_9                                    nolink
  136.     thing        cam_10                                    nolink
  137.     thing        cam1spot                                local
  138.     thing        sidecam                                    local
  139.     
  140.     thing        c_t1                                    nolink
  141.     thing        c_t2                                    nolink
  142.     thing        c_t3                                     nolink
  143.     thing        c_t4                                    nolink
  144.     thing        c_t5                                    nolink
  145.     thing        c_t6                                    nolink
  146.     thing        c_t7                                    nolink
  147.     thing        c_t8                                    nolink
  148.     thing        c_t9                                    nolink
  149.     thing        c_t10                                    nolink
  150.     thing        cam1look                                local
  151.     thing        sidetarg                                local
  152.  
  153.     thing        jeep                                    nolink
  154.     
  155.     thing        jp_t1                                    nolink
  156.     thing        jp_t2                                    nolink
  157.     thing        jp_t3                                    nolink
  158.     thing        jp_t4                                    nolink
  159.     thing        jp_t5                                    nolink
  160.     thing        jp_t6                                    nolink
  161.     thing        jp_t7                                    nolink
  162.     thing        jp_t8                                    nolink
  163.  
  164.     thing        jp_lk1                                    nolink
  165.     thing        jp_lk2                                    nolink
  166.     thing        jp_lk3                                    nolink
  167.     thing        jp_lk4                                    nolink
  168.  
  169.     thing       jeep_actor                              local
  170.        
  171.     thing       fadeplane
  172.     
  173.     thing       bugbox
  174.                        
  175.     # ********************* ENGINE REFS ********************
  176.             
  177.     sector        trigger                                 linkid=3
  178.     sector      shieldsector0                           
  179.     sector      shieldsector1                           
  180.     sector      shieldsector2                             
  181.     sector        camsector                                local
  182.  
  183.     surface     triggerturner                           
  184.  
  185.     template    jeep_actor_tpl=jeep_actor_pyr            local
  186.     template    tpl_indy=indy_sh_actor                    local
  187.     template    tpl_ghost=ghost                            local
  188.  
  189.     # ********************* VARIABLES **********************
  190.  
  191.     vector        indyHeadAim                                local
  192.     vector        v_playpos                                local
  193.     vector        v_turnpos                                local
  194.     vector        v_camspot                                local
  195.     vector        v_aim                                    local
  196.     
  197.     flex        turnerCollSize                            local
  198.     flex        turnerMass                                local
  199.     flex        in_rotRate                                local
  200.     flex        trn_rotRate                                local
  201.     flex        jeep_rotRate                            local
  202.     flex        f_x                                        local
  203.     flex        f_y                                        local
  204.     flex        f_z                                        local
  205.  
  206.     flex        giveidolandexit                         local
  207.                             
  208.     int            in_keyTrack1                            local
  209.     int            in_keyTrack2                            local
  210.  
  211.     int            trn_keyTrack1                            local
  212.     int            trn_keyTrack2                            local
  213.         
  214.     int            in_ArmTrack                                local
  215.     int            trn_ArmTrack                            local
  216.             
  217.     int            in_swap=0                                local
  218.     int            trn_swap=0                                local
  219.                         
  220.     int            sender                                    local
  221.     int            curSound                                local
  222.     int            curCam                                    local
  223.  
  224.     int            cutSceneState=0                            local
  225.  
  226.     int            matAnimNum                                local
  227.     int            actorMeshNum                            local
  228.     int            actorSwapRef                            local
  229.     int            turnerCollType                            local
  230.     int         crosflag = 0                            local
  231.     int            camexists=0                                local
  232.     
  233.     int            mardukIdol=83                            local # inventory bin
  234.     int            tempIdol=0                                local # for test only
  235.     
  236.     int         jeepstart_chan                          local
  237.     int         jeeprevrs_chan                          local
  238.     int         jeepshift_chan                          local
  239.     int         in_jeepkey_rev                          local
  240.     
  241. end
  242.  
  243. # ===================================================================
  244.  
  245. code
  246.  
  247. # -------------------------------------------------------------------
  248.  
  249. startup:
  250.  
  251.     # Pointer to Player
  252.     player = GetLocalPlayerThing();
  253.     SetThingFlags(bugbox, 0x80000);
  254.     
  255.     turnerCollSize = GetThingCollideSize(turner);
  256.     turnerCollType = GetCollideType(turner);
  257.     turnerMass = GetThingMass(turner);
  258.     trn_rotRate = GetThingMaxRotVel(turner);
  259.     AISetCutsceneMode(turner);
  260.     trn_keyTrack1 = PlayKey(turner, trn_lounge, 2, 0x10, 0); # lean against jeep
  261.     
  262.     ThingFadeAnim(fadeplane, 1, 0, 0.1, 0);
  263.  
  264.     return;
  265.  
  266. # -------------------------------------------------------------------
  267.  
  268. crossed:
  269.     if ((GetSenderRef() == triggerturner) && (crosflag == 0) && (GetSourceRef() == player))
  270.     {
  271.         crosflag = 1;
  272.         ClearThingFlags(turner, 0x80000);
  273.         ClearThingFlags(bugbox, 0x40080000); 
  274.     }
  275.     return;
  276.  
  277. # -------------------------------------------------------------------
  278.  
  279. entered:
  280.  
  281.     # NOTE:  this cog only responds to "entered" the first time
  282.     # Indy encounters Turner in this area of Babylon
  283.     
  284.     if ((GetSenderRef() == trigger) && (cutSceneState == 0)) # was 1
  285.     {
  286.         SetActorFlags(player, 0x200000);
  287.         cutSceneState = 1; # only play the full version one time
  288.         
  289.         RestoreExtCam(); # temp devo stuff
  290.         Sleep(0.01); # temp devo stuff
  291.         
  292.         curCam = GetCurrentCamera();
  293.         
  294.         StartCutscene(1);
  295.         Sleep(1.2);
  296.         
  297.         # Disable and hide player...
  298.         StopThing(player);
  299.         DeselectWeaponWait(player);
  300.         
  301.         # Prep camera...
  302.         SetCameraLookInterp(2, 0);
  303.         SetCameraPosInterp(2, 0);
  304.         Sleep(0.01);
  305.         
  306.         # Prep actor indy...
  307.         CopyPlayerHolsters(player, indy);
  308.         SetThingFlags(player, 0x80000);
  309.         ClearThingFlags(indy, 0x80000); # our actor
  310.         in_rotRate = GetThingMaxRotVel(indy);
  311.         SetThingMaxRotVel(indy, 350.0);
  312.         
  313.         # Cut to watch him...
  314.         SetCameraFocus(2, cam_1);
  315.         SetCameraSecondaryFocus(2, c_t1);
  316.         SetCurrentCamera(2);
  317.         SetCameraFOV(70, 0, 0.0);
  318.         
  319.         # Walk Indy...
  320.         AISetMoveSpeed(indy, 1.0);
  321.         AISetLookThing(indy, turner);
  322.         AISetMoveThing(indy, in_mark_2, 0);
  323.         
  324.         # Dolly back to frame Turner and jeep...
  325.         SetCameraLookInterp(2, 1);
  326.         SetCameraPosInterp(2, 1);
  327.         SetCameraInterpSpeed(2, 2.0); # speed is actually time (was 3.0)
  328.         Sleep(0.01);
  329.         SetCameraFocus(2, cam_2);
  330.         SetCameraSecondaryFocus(2, c_t2);
  331.         SetCameraFOV(60, 1, 2.0);
  332.         AIWaitForStop(indy);
  333.         
  334.         # Turner:  "Ahh, Jones, there you are..."
  335.         cursound = PlayVoice(turner, trn_GotStatue, 1.0, 0.0);
  336.         
  337.         # Turner steps over...
  338.         AISetLookThing(turner, indy);
  339.         AISetLookThing(indy, turner);
  340.         Sleep(0.01);
  341.         StopKey(turner, trn_keyTrack1, 0.0); # stop playing the lounge
  342.         PlayKey(turner, trn_tenhut, 4, 0x12, 1); # stand turner up
  343.         trn_keyTrack1 = PlayKey(turner, trn_handships, 2, 0x10, 0);
  344.         AISetLookThing(turner, indy);
  345.         AISetLookThing(indy, turner);
  346.         Sleep(0.4);
  347.         PlayKey(turner, trn_leftUp, 4, 0x12, 1);
  348.         WaitForSound(curSound);
  349.         
  350.         # Establish forthcoming talk radius & nail Turner to this spot...
  351.         SetThingCollideSize(turner, 0.04);    # doubled, so talk distance will be right later
  352.         SetThingMass(turner, 0); # 0 = infinite...don't let player push turner around!
  353.         
  354.         if (GetInv(player, mardukIdol) == 1 && cutSceneState != 3)
  355.         {
  356.             # If Indy has the Marduk statue, complete the scene right now...
  357.             call GiveIdolAndExit;
  358.             EndCutscene();
  359.             JonesEndLevel();
  360.             return;
  361.         }
  362.         
  363.         if (GetInv(player, mardukIdol) == 0 && cutSceneState != 3)
  364.         {
  365.             # If Indy doesn't have the statue, the scene stalls...
  366.             
  367.             # Cut to close-up of Indy...
  368.             SetCameraLookInterp(2, 0);
  369.             SetCameraPosInterp(2, 0);
  370.             SetCameraFocus(2, cam_3);
  371.             SetCameraSecondaryFocus(2, c_t3);
  372.             SetCameraFOV(38, 0, 0.0);
  373.             Sleep(0.01);
  374.             
  375.             # Indy: "Sorry, not yet..."
  376.             in_keyTrack1 = PlayKey(indy, in_handsOnHips, 2, 0x14, 0);
  377.             PlayKey(indy, in_handsToHips, 4, 0x12, 1);
  378.             PlayKey(indy, in_PushHat, 4, 0x12, 0);
  379.             cursound = PlayVoice(indy, in_NotYet, 1.0, 0);
  380.             Sleep(1.7);
  381.             WaitForSound(curSound);
  382.             StopKey(indy, in_keyTrack1, 0.0);
  383.             
  384.             # Move player into new position before we need him...
  385.             TeleportThing(player, indy);
  386.             StopThing(player); # and calm him down
  387.             ResetThing(player);
  388.             
  389.             # Cut to close-up of Turner...
  390.             SetCameraFocus(2, cam_4);
  391.             SetCameraSecondaryFocus(2, c_t4);
  392.             SetCameraFOV(45, 0, 0.0); # was 40
  393.             SetThingFlags(indy, 0x10); # invisible
  394.         
  395.             # Turner: "And here I thought..."
  396.             cursound = PlayVoice(turner, trn_HelpEachOther, 1.0, 0.0);
  397.             Sleep(0.01);
  398.             trn_keyTrack2 = PlayKey(turner, trn_givekey, 4, 0x12, 0);
  399.             Sleep(4.0);
  400.             PlayKey(turner, trn_fistshake, 4, 0x12, 0);
  401.             WaitForSound(curSound);
  402.             Sleep(0.4);
  403.         
  404.             # Clean up...
  405.             SetCameraLookInterp(2, 0);
  406.             SetCameraPosInterp(2, 0);
  407.             
  408.             # restore player control...
  409.             v_camspot = VectorAdd(VectorTransformToOrient(indy, '0.2 -0.02 0.0'), GetThingPos(indy));
  410.             SetCameraPosition(1, v_camspot); # prep follow-cam
  411.             SetThingFlags(indy, 0x80010);
  412.             ClearThingFlags(player, 0x80000);
  413.             SetCurrentCamera(curCam);
  414.             ResetCameraFOV(0, 0.0);
  415.  
  416.             EndCutScene();
  417.             SetThingMaxRotVel(turner, 300.0);
  418.             AIClearCutSceneMode(turner);
  419.             ClearActorFlags(player, 0x200000);
  420.         }
  421.     }
  422.     return;
  423.  
  424. # -------------------------------------------------------------------
  425.     
  426. activated:
  427.  
  428.     # NOTE:  this executes when player activates Turner...
  429.  
  430.     if (GetSenderRef() != turner)
  431.     {
  432.         return;
  433.     }
  434.  
  435.     # set up...
  436.     SetActorFlags(player, 0x200000);
  437.     StartCutscene(1);
  438.     StopThing(player);
  439.     MakeMeStop();
  440.     CopyPlayerHolsters(player, indyAlt);
  441.     TeleportThing(indyAlt, player); # plant dupe
  442.     AISetCutsceneMode(turner);
  443.     SetThingMaxRotVel(turner, trn_rotRate);
  444.  
  445.     # Make cams...
  446.     if (camexists == 0)
  447.     {
  448.         cam1spot = CreateThing(tpl_ghost, indyAlt);
  449.         CaptureThing(cam1spot);
  450.         cam1look = CreateThing(tpl_ghost, indyAlt);    
  451.         CaptureThing(cam1look);
  452.     }
  453.     else
  454.     {
  455.         DestroyThing(indyghost);
  456.         DestroyThing(sidecam);
  457.         DestroyThing(sidetarg);
  458.     }
  459.     camexists = 1;
  460.     indyghost = CreateThing(tpl_indy, indyAlt);
  461.     CaptureThing(indyghost);
  462.     v_playpos = GetThingPos(player);
  463.     v_turnpos = GetThingPos(turner);
  464.     f_x  = VectorX(v_turnpos);
  465.     f_y = VectorY(v_turnpos);
  466.     f_z = VectorZ(v_playpos);
  467.     v_turnpos = VectorSet(f_x, f_y, f_z); # force Indy height
  468.     v_aim = VectorNorm(VectorSub(v_turnpos, v_playpos));
  469.     SetThingLook(indyghost, v_aim);
  470.  
  471.     v_playpos = GetThingPos(indyghost);
  472.     v_camspot = VectorAdd(VectorTransformToOrient(indyghost, '0.15 0.02 0.06'), v_playpos);    
  473.     camsector = FindNewSectorFromThing(indyghost, v_camspot);
  474.     sidecam = CreateThingAtPos(tpl_ghost, camsector, v_camspot, '0 0 0');
  475.     CaptureThing(sidecam);
  476.     v_camspot = VectorAdd(VectorTransformToOrient(indyghost, '0.0 0.05 0.005'), v_playpos);    
  477.     camsector = FindNewSectorFromThing(indyghost, v_camspot);
  478.     sidetarg = CreateThingAtPos(tpl_ghost, camsector, v_camspot, '0 0 0');
  479.     CaptureThing(sidetarg);
  480.  
  481.     # Slew cam to side view...
  482.     MakeCamera2LikeCamera1(cam1spot, cam1look);
  483.     SetCameraLookInterp(2, 0);
  484.     SetCameraPosInterp(2, 0);
  485.     SetCameraFocus(2, cam1spot);
  486.     SetCameraSecondaryFocus(2, cam1look);
  487.     SetCurrentCamera(2);
  488.     ResetCameraFOV(0, 0.0);
  489.     SetCameraLookInterp(2, 1);
  490.     SetCameraPosInterp(2, 1);
  491.     SetCameraInterpSpeed(2, 0.8);
  492.     Sleep(0.01);
  493.     SetCameraFocus(2, sidecam);
  494.     SetCameraSecondaryFocus(2, sidetarg);
  495.  
  496.     SetThingFlags(player, 0x80000);
  497.     ClearThingFlags(indyAlt, 0x80000);
  498.     AISetLookThing(indyAlt, turner);
  499.     AISetLookThing(turner, indyAlt);
  500.         
  501.     if (GetInv(player, mardukIdol) == 1)
  502.     ######## if (tempIdol == 1)
  503.     {
  504.         # 83 is item ID for "statuette of winged god Marduk"
  505.         # If Indy has the statue, complete the level right now...
  506.  
  507.         Sleep(0.5);
  508.  
  509.         # Turner asks about statue again...
  510.         if (cutSceneState == 1)
  511.         {
  512.             cursound = PlayVoice(turner, trn_WhereStatue, 1.0, 0.0);
  513.         }
  514.         if (cutSceneState > 1)
  515.         {
  516.             cursound = PlayVoice(turner, trn_StatueJones, 1.0, 0.0);
  517.         }
  518.         WaitForSound(curSound);
  519.         
  520.         # call function that finishes up
  521.         call GiveIdolAndExit;
  522.         EndCutscene();
  523.         JonesEndLevel();
  524.     }
  525.  
  526.     if (cutSceneState == 2)
  527.     {
  528.         # if scene has played twice, run this shorter version as often as needed...
  529.  
  530.         Sleep(0.5);
  531.  
  532.         # Turner: "The statue, Jones?"
  533.         cursound = PlayVoice(turner, trn_StatueJones, 1.0, 0.0);
  534.         WaitForSound(curSound);
  535.  
  536.         # Indy: "Yeah, yeah, I know."
  537.         cursound = PlayVoice(indyAlt, in_YeahIKnow, 1.0, 0.0);
  538.         
  539.         in_keyTrack1 = PlayKey(indyAlt, in_armsCrossed, 2, 0x10, 0);
  540.         PlayKey(indyAlt, in_crossArms, 4, 0x12, 1);
  541.         WaitForSound(curSound);
  542.         
  543.         # Turner: "I'm still waiting."
  544.         cursound = PlayVoice(turner, trn_StillWaiting, 1.0, 0.0);
  545.         PlayKey(turner, trn_reach, 4, 0x12, 0);
  546.         Sleep(1.0);
  547.         StopKey(indyAlt, in_keyTrack1, 0.5);
  548.         WaitForSound(curSound);
  549.  
  550.         ######## REMOVE BEFORE FLIGHT ########
  551.         ######## tempIdol = 1; # for testing purposes only!
  552.         ######## REMOVE BEFORE FLIGHT ########
  553.         
  554.         SetThingFlags(indyAlt, 0x80000); # hide dupe actor indy
  555.         ClearThingFlags(player, 0x80000);
  556.         SetCameraPosition(1, GetThingPos(sidecam));
  557.         SetCurrentCamera(1);
  558.  
  559.         EndCutscene();
  560.         SetThingMaxRotVel(turner, 300.0);
  561.         AIClearCutSceneMode(turner);
  562.         ClearActorFlags(player, 0x200000);
  563.     }
  564.             
  565.     if (cutSceneState == 1)
  566.     {
  567.         # if scene has already played once, run this...
  568.             
  569.         cutSceneState = 2; # only play this version one time
  570.         Sleep(0.5);
  571.         
  572.         # Turner: "Well, where's the statue?"
  573.         cursound = PlayVoice(turner, trn_WhereStatue, 1.0, 0.0);
  574.         # gestures here
  575.         trn_keyTrack2 = PlayKey(turner, trn_foldArms, 4, 0x14, 0);
  576.         Sleep(0.5);
  577.         in_keyTrack1 = PlayKey(indyAlt, in_handsOnHips, 2, 0x10, 0);
  578.         PlayKey(indyAlt, in_handsToHips, 4, 0x12, 1);
  579.         WaitForSound(curSound);
  580.  
  581.         # Indy: "I'm working on it."
  582.         cursound = PlayVoice(indyAlt, in_WorkOnIt, 1.0, 0.0);
  583.         WaitForSound(curSound);
  584.  
  585.         # Turner: "I'll be waiting."
  586.         cursound = PlayVoice(turner, trn_BeWaiting, 1.0, 0.0);
  587.         # gestures here
  588.         Sleep(1.0);
  589.         WaitForSound(curSound);
  590.         StopKey(indyAlt, in_keyTrack1, 0.5);
  591.         StopKey(turner, trn_keyTrack2, 0.5);
  592.         Sleep(0.5);
  593.         
  594.         SetThingFlags(indyAlt, 0x80000);
  595.         ClearThingFlags(player, 0x80000);
  596.         SetCameraPosition(1, GetThingPos(sidecam));
  597.         SetCurrentCamera(1);
  598.             
  599.         EndCutscene();
  600.         SetThingMaxRotVel(turner, 300.0);
  601.         AIClearCutSceneMode(turner);
  602.         ClearActorFlags(player, 0x200000);
  603.     }
  604.  
  605.     return;
  606.  
  607. # -------------------------------------------------------------------
  608.  
  609. GiveIdolAndExit:
  610.  
  611.     cutSceneState = 3; # we're finishing scene now
  612.     SectorAdjoins(shieldsector0, 0);
  613.     SectorAdjoins(shieldsector1, 0);
  614.     SectorAdjoins(shieldsector2, 0);
  615.     
  616.     # Show Indy on his mark...
  617.     DestroyThing(indyAlt); # don't need dupe no more
  618.     SetThingFlags(player, 0x80000);
  619.     ClearThingFlags(indy, 0x80010);
  620.     Sleep(0.01);
  621.  
  622.     # Cut to close-up of Indy...
  623.     SetCameraLookInterp(2, 0);
  624.     SetCameraPosInterp(2, 0);
  625.     SetCameraFocus(2, cam_3);
  626.     SetCameraSecondaryFocus(2, c_t3);
  627.     SetCurrentCamera(2);
  628.     SetCameraFOV(40, 0, 0.0);
  629.     Sleep(0.01);
  630.     AISetLookThing(indy, turner);
  631.     AISetLookThing(turner, indy);
  632.     
  633.     # Indy: "Will this do?"
  634.     cursound = PlayVoice(indy, in_ThisDo, 1.0, 0.0);
  635.  
  636.     # Lift statue into view...
  637.     SetThingMesh(indy, 15, inhand_mdkstat, 0);
  638.     in_keyTrack1 = PlayKey(indy, in_showMarduk, 2, 0x14, 0);
  639.     WaitForSound(curSound);
  640.     Sleep(0.5);
  641.  
  642.     # Cut to side-view of Indy and Turner
  643.     SetCameraFocus(2, cam_10);
  644.     SetCameraSecondaryFocus(2, c_t10);
  645.     SetCurrentCamera(2);
  646.     SetCameraFOV(28, 0, 0.0);
  647.  
  648.     # Turner: "It just might!  Anything else?"
  649.     cursound = PlayVoice(turner, trn_JustMight, 1.0, 0.0);
  650.  
  651.     # Dolly into reverse angle on Indy over Turner's shoulder...
  652.     SetCameraInterpSpeed(2, 18.5); # speed is actually time
  653.     SetCameraLookInterp(2, 1);
  654.     SetCameraPosInterp(2, 1);
  655.     Sleep(0.01);
  656.     SetCameraFocus(2, cam_6);
  657.     SetCameraSecondaryFocus(2, c_t6);
  658.     SetCameraFOV(45, 1, 7.0); # widen angle
  659.  
  660.     # Give & take Marduk statuette...
  661.     StopKey(indy, in_keyTrack1, 0.0);
  662.     PlayKey(indy, in_giveMarduk, 4, 0x12, 0);       # 1.37 sec
  663.     PlayKey(turner, trn_getMarduk, 4, 0x12, 0);     # 1.37 sec
  664.     sleep(0.685);
  665.     SetThingMesh(turner, 5, tuhand_mdkstat, 0);      
  666.     SetThingMesh(indy, 15, tu_hand, 0);
  667.     sleep(0.685);
  668.     PlayKey(turner, trn_stowMarduk, 4, 0x12, 0);    # 2.23 sec
  669.     StopKey(indy, in_keyTrack1, 0.5); # Indy relaxes from giving statue
  670.     sleep(1.12);
  671.     SetThingMesh(turner, 5, tu_hand, 0);
  672.     
  673.     # Lose statue from inventory...
  674.     SetInv(player, mardukIdol, 0.00);
  675.  
  676.     # Indy: "According to the inscription..."
  677.     WaitForSound(curSound);
  678.     cursound = PlayVoice(indy, in_TowerExpo, 1.0, 0);
  679.     PlayKey(indy, in_inscription, 4, 0x12, 1);
  680.     SetCameraFOV(34, 1, 8.3); # tighten up again
  681.     WaitForSound(curSound);
  682.  
  683.     # Turner: "Taking them...where?"
  684.     cursound = PlayVoice(turner, trn_DisciplesWhere, 1.0, 0.0);
  685.     PlayKey(turner, trn_leftUp, 4, 0x12, 1);
  686.     WaitForSound(curSound);
  687.  
  688.     # Indy: "Not sure, except...Urgon...heavenly mountains..."
  689.     cursound = PlayVoice(indy, in_NotSure, 1.0, 0);
  690.     PlayKey(indy, in_urgon, 4, 0x12, 1);
  691.     WaitForSound(curSound);
  692.  
  693.     # Turner: "That's not much help."
  694.     cursound = PlayVoice(turner, trn_NotMuch, 1.0, 0.0);
  695.     PlayKey(turner, trn_nothelp, 4, 0x12, 0);
  696.     WaitForSound(curSound);
  697.  
  698.     # Cut to Indy...
  699.     SetCameraLookInterp(2, 0);
  700.     SetCameraPosInterp(2, 0);
  701.     Sleep(0.01);
  702.     SetCameraFocus(2, cam_5);
  703.     SetCameraSecondaryFocus(2, c_t5);
  704.     SetCameraFOV(42, 0, 0.0); # was 35
  705.     SetThingFlags(turner, 0x10); # invisible
  706.     
  707.     # Indy: "Might be enough...Tian Shan..."
  708.     cursound = PlayVoice(indy, in_Enough, 1.0, 0.0);
  709.     PlayKey(indy, in_heavenly, 4, 0x12, 1);
  710.     WaitForSound(curSound);
  711.  
  712.     # Cut to Turner over Indy's shoulder...
  713.     SetCameraFocus(2, cam_7);
  714.     SetCameraSecondaryFocus(2, c_t7);
  715.     SetCameraFOV(36, 0, 0.0);
  716.     ClearThingFlags(turner, 0x10); # visible again
  717.     
  718.     # Turner: "Kazakstan?  ...Soviet territory."
  719.     cursound = PlayVoice(turner, trn_KazakSoviet, 1.0, 0.0);
  720.     PlayKey(turner, trn_sovietland, 4, 0x12, 1);
  721.     WaitForSound(curSound);
  722.     
  723.     # Indy: "Maybe I won't show the border guards..."
  724.     cursound = PlayVoice(indy, in_NoPassport, 1.0, 0.0);
  725.     PlayKey(indy, in_ArmsOut, 4, 0x12, 0);
  726.     Sleep(0.4);
  727.  
  728.     # Dolly and boom to wider shot...
  729.     SetCameraInterpSpeed(2, 2.2); # speed is actually time (was 3.0)
  730.     SetCameraLookInterp(2, 1);
  731.     SetCameraPosInterp(2, 1);
  732.     Sleep(0.01);
  733.     SetCameraFocus(2, cam_9);
  734.     SetCameraSecondaryFocus(2, c_t9);
  735.     SetCameraFOV(75, 1, 2.2); # (was 3.0)
  736.     WaitForSound(curSound);
  737.  
  738.     # Turner: "Okay, buddy.  It's your funeral."
  739.     cursound = PlayVoice(turner, trn_YourFuneral, 1.0, 0.0);    
  740.  
  741.     # Turner moves aside...
  742.     StopKey(turner, trn_keyTrack1, 0.0); # kill low-priority hands-on-hips anim
  743.     trn_keyTrack1 = PlayKey(turner, trn_beMyGuest, 4, 0x14, 0);
  744.     Sleep(2.0);
  745.     SetCollideType(turner, 0); 
  746.     WaitForSound(curSound);
  747.     
  748.     # Ending Theme
  749.     PlaySoundLocal(itsawrap, 1, 0, 0, 0);
  750.  
  751.     # Prep camera to follow jeep...
  752.     SetCameraInterpSpeed(2, 6.0); # speed is actually time
  753.     
  754.     SetCameraFocus(2, cam_8);
  755.     SetCameraSecondaryFocus(2, c_t8);
  756.     SetCameraFOV(70, 1, 2.0);
  757.     
  758.     # Put Indy into the jeep...
  759.     AISetLookThing(indy, jeep);
  760.     AISetMoveThing(indy, in_mark_3, 0);
  761.     AIWaitForStop(indy);
  762.     DestroyThing(jeep);
  763.     DestroyThing(indy);
  764.    
  765.     # Make a jeep with Indy in it...
  766.     jeep_actor = CreateThing(jeep_actor_tpl, jeep);
  767.     CaptureThing(jeep_actor);
  768.     ClearThingFlags(jeep_actor, 0x80000);
  769.     AttachThingToThing(c_t8, jeep_actor); # so cam will follow
  770.     PlayKey(jeep_actor, jpa_mountJeep, 4, 0x12, 1); # sit our hero down
  771.     Sleep(0.5);
  772.     
  773.     jeepstart_chan=PlaySoundThing(jeep_start_wav, jeep_actor, 1, 10, 20, 0);
  774.     WaitForSound(jeepstart_chan);
  775.     
  776.     # Cut to watch Indy go brrrrmm...
  777.     jeep_rotRate = GetThingMaxRotVel(jeep_actor);
  778.     SetThingMaxRotVel(jeep_actor, 50.0); # resist turning
  779.     in_keyTrack1 = PlayKey(jeep_actor, jpa_steerL, 2, 0x04, 0);
  780.     in_jeepkey_rev = PlayKey(jeep_actor, jeep_runbackward, 2, 0x0, 0);
  781.     jeeprevrs_chan=PlaySoundThing(jeep_rev_wav, jeep_actor, 1, 10, 20, 0x81);
  782.     //SetCameraInterpSpeed(2, 0); # yes, do this
  783.     //SetCameraLookInterp(2, 0);
  784.     
  785.     AISetMoveSpeed(jeep_actor, 1.0);
  786.     AISetLookThing(jeep_actor, jp_lk1);
  787.     AISetMoveThing(jeep_actor, jp_t1, 0);
  788.     Sleep(0.5);
  789.     AISetMoveSpeed(jeep_actor, 1.5);
  790.     AISetLookThing(jeep_actor, jp_lk2);
  791.     AISetMoveThing(jeep_actor, jp_t2, 0);
  792.     Sleep(0.4);
  793.     AISetMoveSpeed(jeep_actor, 2.0);
  794.     AISetLookThing(jeep_actor, jp_lk3);
  795.     AISetMoveThing(jeep_actor, jp_t3, 0);
  796.     Sleep(0.4);
  797.     AISetMoveSpeed(jeep_actor, 1.5);
  798.     AISetMoveThing(jeep_actor, jp_t4, 0);
  799.     Sleep(0.4);
  800.     AISetMoveSpeed(jeep_actor, 1.0);
  801.     AISetLookThing(jeep_actor, jp_lk4);
  802.     AISetMoveThing(jeep_actor, jp_t5, 0);
  803.     Sleep(1.0);
  804.     StopKey(jeep_actor, in_keyTrack1, 0.5);
  805.     StopKey(jeep_actor, in_jeepkey_rev, 0.1);
  806.     Sleep(0.5);
  807.     
  808.     StopSound(jeeprevrs_chan, 0);
  809.     jeepshift_chan = PlaySoundThing(jeep_actor, jeep_shift_wav, 1, 10, 20, 0x0080);
  810.     WaitForSound(jeepshift_chan);
  811.     StopSound(jeepshift_chan, 0);
  812.     in_keyTrack1 = PlayKey(jeep_actor, jeep_runforward, 2, 0x00, 0);
  813.     PlaySoundThing(jeep_fwd_wav, jeep_actor, 1, 10, 20, 0x0081);
  814.     AISetMoveSpeed(jeep_actor, 2.0);
  815.     AISetLookThing(jeep_actor, jp_t6);
  816.     AISetMoveThing(jeep_actor, jp_t6, 0);
  817.     Sleep(0.6);
  818.  
  819.     # Prep Turner to move again...
  820.     StopKey(turner, trn_keyTrack1, 0.0);
  821.     SetThingMass(turner, turnerMass); # back to normal
  822.     SetCollideType(turner, turnerCollType);
  823.     SetThingCollideSize(turner, turnerCollSize);
  824.     AISetMoveSpeed(turner, 1);
  825.     AISetLookThing(turner, jp_lk3);
  826.     Sleep(0.01);
  827.     AISetMoveSpeed(jeep_actor, 3.0);
  828.     Sleep(1.0);
  829.     
  830.     # Walk Turner into the shot...
  831.     AISetMoveThing(turner, jp_lk3, 0);
  832.     Sleep(0.5);
  833.  
  834.     AISetMoveSpeed(jeep_actor, 4.0);
  835.     Sleep(0.5);
  836.     DetachThing(c_t8); # final framing
  837.     StopThing(c_t8);
  838.  
  839.     AIWaitForStop(turner);
  840.     trn_keyTrack1 = PlayKey(turner, trn_handships, 2, 0x0, 0);
  841.     PlayKey(turner, trn_handstohips, 4, 0x12, 0);
  842.     
  843.     # New turn exit...
  844.     AISetLookThing(jeep_actor, jp_t7);
  845.     AISetMoveThing(jeep_actor, jp_t7, 0);
  846.     Sleep(1.2);
  847.     AISetLookThing(jeep_actor, jp_t8);
  848.     AISetMoveThing(jeep_actor, jp_t8, 0);
  849.     Sleep(1.8);
  850.     
  851.     AttachThingToThing(fadeplane, cam_8);
  852.     ThingFadeAnim(fadeplane, 0, 1, 2, 0);
  853.     Sleep(2.0);
  854.     
  855.     # Default actors (too bad we don't have a command for this)...
  856.     SetThingMaxRotVel(turner, trn_rotRate);
  857.     SetThingMaxRotVel(jeep_actor, jeep_rotRate);
  858.     
  859.     # Kill any lingering animations...
  860.     StopKey(jeep_actor, in_keyTrack1, 0.0);
  861.     StopKey(turner, trn_keyTrack1, 0.0);
  862.     
  863.     # Fix up the camera...
  864.     SetCameraLookInterp(2, 0);
  865.     SetCameraPosInterp(2, 0);
  866.     SetCurrentCamera(2);
  867.     ResetCameraFOV(0, 0.0);
  868.  
  869. return;
  870.  
  871. end
  872.